﻿@{
    Layout = "~/Views/Shared/_General.cshtml";
    ViewBag.SiteCategory = "game";
}
@model CardInChina.Data.Entity.Entity.CardInfo
@*<script type="text/javascript">
    $(function () {
        //high light li(0)
        $("div#SiteIndex ul li.@ViewBag.Category a").addClass("xt");

        $("select.products_name_chose").bind("change", function (e) {
            var currency_type = $(this).val();
            var currency_type_str = $(this).children("option:selected").text();
                 var cardinforid1 = $(this).parent().attr('id');
                 var params = '{CurrencyType:"' + currency_type + '",CardID:"' + cardinforid1 + '"}';
                 $.ajax({
                    type: "POST",
                    cache:false,
                    url: "@Url.Action("GetCardPriceInfo", "Exchange")",
                    data: params,
                    dataType: "json",
                    contentType: "application/json; charset=utf-8",
                    success: function (result) {
                        var cardid = result.CardId;
                        var commonprice = result.CommomPrice;
                        var vipprice = result.VIPPrice;
                        var divitem = $("div#" + cardid); 
                        divitem.find(".products_arrow_price1").html(currency_type_str);
                        divitem.find(".commonprice").html(commonprice);
                        divitem.find(".vipprice").html(vipprice);
                    },
                    error: function (xhr, msg, e) {
                        alert(msg);
                    }
                 });
             });

            $("a.purchaseA").bind("click",function(){
                var src = $(this).attr("href");
                var parent_div = $(this).parents("div.products_arrow:first");
                var selectVal = parent_div.prev().find("select.products_name_chose").val();
                location.href = src + "/" + selectVal;
                return false;
            });
    });
</script>*@
<div class="main_center">
    <div class="weizhi">
        <div class="weizhi_bg ui-icons">
            <p>@Model.CardName</p>
        </div>
    </div>
    <div class="products">
        <div class="show">
            <div class="pic">
                <img alt="" src="/content/images/photo/@Model.Photo" />
            </div>
        </div>
        <div class="info">
            <p class="head_title">
                <span>@Model.CardName</span></p>
            <p class="head_game">
                适应游戏：
                @foreach (CardInChina.Data.Entity.Entity.Game g in ViewBag.Games)
                {
                    @Html.ActionLink(g.GameName, "Index", "Game", new { gameKey = g.GameKey }, null);
                }
            </p>
        </div>
        <div class="clear">
        </div>
        <div class="introduc_info-prod">
            <div class="tab2_area">
                <ul class="tab2_head tabs">
                    <li class=""><a href="#tab1">卡介绍</a></li>
                    <li class=""><a href="#tab2">详细介绍</a></li>
                </ul>
            </div>
            <div class="tab2_container">
                <div class="introduc_area-prod tab2_content" id="tab1">
                    <div class="introduc_areaT">
                    </div>
                    <div class="introduc_area_bg">
                        @Html.Raw(Model.FreeRatio)
                    </div>
                    <div class="introduc_areaD">
                    </div>
                </div>
                <div class="introduc_area-prod tab2_content" id="tab2">
                    <div class="introduc_areaT">
                    </div>
                    <div class="introduc_area_bg">
                        @Html.Raw(Model.Description)
                    </div>
                    <div class="introduc_areaD">
                    </div>
                </div>
            </div>
        </div>
        <div class="Related_title_bg ui-icons">
            <p>
                相关 <span>@Model.CardName</span> 的商品：</p>
        </div>
        @foreach (var c in @Model.OfCards)
        {
            @Html.Partial("CardItemInCardDetailTemplate", c);
        }
        <div class="clear">
        </div>
    </div>
</div>


<script type="text/javascript">
    $(function () {

        //         二列卡片切换
        //Default Action 
        $(".tab2_content").hide(); //Hide all content
        $("ul.tabs li:first").addClass("c").show(); //Activate first tab 
        $(".tab2_content:first").show(); //Show first tab content 
        //On Click Event 
        $("ul.tabs li").click(function () {
            $("ul.tabs li").removeClass("c"); //Remove any "active" class 
            $(this).addClass("c"); //Add "active" class to selected tab 
            $(".tab2_content").hide(); //Hide all tab content 
            var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content 
            $(activeTab).show(); //Fade in the active content 
            return false;
        });

    });
</script>
